package com.helei.sentinel.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author helei
 * @description sentinelController
 * @date 2020/11/11 14:37
 */
@RestController
public class sentinelController {

    @GetMapping(value = "/aa")
    public String aa(){
        return "qqqq";
    }
    @GetMapping(value = "/bbbb")
    public String bbbb(){
        return "bbbb";
    }

    @GetMapping(value = "/cc")
    @SentinelResource(value = "cc",blockHandler = "cc_del")
    public String cc(){
        return "cc";
    }

    public String cc_del(BlockException e){
        return "cc_del";
    }

    @GetMapping(value = "/qqq")
    @SentinelResource(value = "qqq",blockHandlerClass = CustmerHeadler.class,blockHandler = "handlerExcetion2")
    public String qq(){
        return "cdsdc";
    }
}
